//
//  LXSliderView.m
//  bgms_d
//
//  Created by Mountain on 27/1/2019.
//  Copyright © 2019 lachesis-zhu. All rights reserved.
//

#import "LXSliderView.h"

@implementation LXSliderView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if(self)
    {
        [self setup];
    }
    
    return self;
}

-(void)setup
{
    
}

- (void)sliderTouchImage:(UIImage *)image whitSize:(CGSize)size
{
    UIImage *tempImage = [self image:image scaleToSize:size];
    [self setThumbImage:tempImage forState:UIControlStateNormal];
    [self setThumbImage:tempImage forState:UIControlStateHighlighted];
}

- (UIImage *)image:(UIImage*)image scaleToSize:(CGSize)size{
    UIGraphicsBeginImageContext(size);
    [image drawInRect:CGRectMake(0,0, size.width, size.height)];
    UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return scaledImage;
}
@end
